package com.slliver.controller;

import com.slliver.pojo.Product;
import com.slliver.service.ProductClientServcie;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {

    private final ProductClientServcie productClientServcie;

//    private final ProductClientServcie productClientServcie;

    public ProductController(ProductClientServcie productClientServcie) {
        this.productClientServcie = productClientServcie;
    }


    @GetMapping("/consumer/product/get/{productId}")
    public Product getProduct(@PathVariable("productId") Long productId){
        Product product = this.productClientServcie.selectById(productId);
        return product;
    }

}
